import Vue from "vue";
import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex);
// 创建仓库store
const store = new Vuex.Store({
    state: {
        token: ''
    },
    //mutations是修改数据的唯一途径
    mutations: {
        setToken(state, token) {
            state.token = token
        }
    },
    actions: {},
    getters: {},
    plugins: [createPersistedState()]
})

// 暴露出去
export default store;